package com.softserveinc.interactive_board.validators.form;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import com.softserveinc.interactive_board.domain.User;

public class ViewProfileForm {
	private Long id;

	@NotEmpty
	@Size(max = User.COLUMNS_MAX_LENGTH)
	@Pattern(regexp = "([A-Z]|[a-z])([A-Z]|[a-z]|[0-9])*")
	private String login;

	@NotEmpty
	@Size(max = User.COLUMNS_MAX_LENGTH)
	@Pattern(regexp = "([A-Z]|[a-z]|[0-9])*")
	private String password;

	@NotEmpty
	@Size(max = User.COLUMNS_MAX_LENGTH)
	private String userType;

	@Size(max = User.COLUMNS_MAX_LENGTH)
	@Email
	private String email;

	@Size(max = User.COLUMNS_MAX_LENGTH)
	private String skype;

	@Size(max = User.SUMMARY_COLUMN_MAX_LENGTH)
	private String summary;

	public ViewProfileForm(final User user) {
		this.login = user.getLogin();
		this.password = user.getPassword();
		this.userType = user.getUserType().getType();
		this.email = user.getEmail();
		this.skype = user.getSkype();
		this.summary = user.getSummary();
	}

	public Long getId() {
		return id;
	}

	public String getLogin() {
		return login;
	}

	public String getPassword() {
		return password;
	}

	public String getUserType() {
		return userType;
	}

	public String getEmail() {
		return email;
	}

	public String getSkype() {
		return skype;
	}

	public String getSummary() {
		return summary;
	}

}
